/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Soligee.decorador;

import com.icesoft.faces.component.ext.HtmlInputSecret;
import com.icesoft.faces.component.ext.HtmlInputText;

/**
 *
 * @author Sem Nome
 */
public class ValidaCamposObrigatorios {

    public boolean verificaCampoVazio(HtmlInputText campo){

        if( campo.getValue().toString().equals("")||campo.getValue().toString().equals(null)){
            campo.setStyle(campo.getStyle()+";"+"background-color:#ffbd77");
            return true;
        }
        else
            campo.setStyle(campo.getStyle()+";"+"background-color:white;");
            return false;
    }

    public boolean verificaCampoVazio(HtmlInputSecret campo){
        if(campo.getValue().toString().equals("")||campo.getValue().toString().equals(null)){
            campo.setStyle(campo.getStyle()+";"+"background-color:#ffbd77;");
            return true;
        }
        else
            campo.setStyle(campo.getStyle()+";"+" background-color:white;");
            return false;
    }

    public boolean limpaCores(HtmlInputText campo){
        campo.setStyle("background-color:white;");
        return true;
    }

    public boolean limpaCoresSenha(HtmlInputSecret campo){
        campo.setStyle("background-color:white;");
        return true;
    }
    public boolean verificaCampoIncorreto(HtmlInputText campo, boolean correto){
        if(!correto){
            campo.setStyle(campo.getStyle()+";"+"background-color:#ffbd77;");
            return false;
        }
        else
            return true;
    }
    
    
}
